# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Vladimir Chizhov <jagoterr@gmail.com>
# Contributor: Robert Emil Berge <filoktetes@linuxophic.org>

pkgname=recoll
pkgver=1.35.0
pkgrel=1
pkgdesc="Full text search tool based on Xapian backend"
arch=('loong64' 'x86_64')
url="https://www.lesbonscomptes.com/recoll/"
license=('GPL')
depends=('xapian-core>=1.0.15-1' 'qt5-base' 'openssl' 'hicolor-icon-theme' 'qt5-webengine'
	 'chmlib' 'aspell')
makedepends=('python' 'python-setuptools' 'qt5-tools')
optdepends=('libxslt: for XML based formats (fb2,etc)'
	    'unzip: for the OpenOffice.org documents'
	    'poppler: for pdf'
	    'pstotext: for postscipt'
	    'antiword: for msword'
	    'catdoc: for ms excel and powerpoint'
	    'unrtf: for RTF'
#	    'untex: for dvi support with dvips'
	    'djvulibre: for djvu'
#	    'id3lib: for mp3 tags support with id3info'
	    'python-mutagen: Audio metadata'
	    'perl-image-exiftool: EXIF data from image files'
	    'python-lxml: indexing spreadsheets'
            'python-pychm: CHM filter'
	    'aspell-en: English stemming support')
source=("https://www.lesbonscomptes.com/$pkgname/$pkgname-${pkgver/_/}.tar.gz")
sha512sums=('35dcbfb650251b00f2c7654dc7617bf24f7e480955121821c55e0d31c6ec4fa041f8f99e64afa12ad4ead725c366084d7d727dbdcee875b93bbc858a6229d236')

prepare() {
  cd "$srcdir/$pkgname-${pkgver/_/}"
  sed -i '1,1i#include <QAbstractItemView>' qtgui/ssearch_w.cpp
}

build() {
  cd "$srcdir/$pkgname-${pkgver/_/}"
  QMAKE=qmake-qt5 ./configure --prefix=/usr --mandir=/usr/share/man --enable-recollq --disable-webkit --enable-webengine
  make
}

package() {
  cd "$srcdir/$pkgname-${pkgver/_/}"
  make DESTDIR="$pkgdir" install
}
